package com.base.controller.cdr;

import com.base.api.cdr.PersonalQueryService;
import com.base.vo.cdr.PersonalVisitInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * @author wnhuang
 * @Package com.base.controller.cdr
 * @date 2020-12-19 10:58
 */
@RestController
@RequestMapping(value = "/cdr")
public class PatientController {

    @Autowired
    PersonalQueryService personalQueryService;

    @GetMapping(value = "/personal/index")
    public ModelAndView personalIndex(@RequestParam Map<String, Object> param) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/personal/index");
        modelAndView.addObject("patientId", param.get("patientId"));
        return modelAndView;
    }

    @PostMapping(value = "/visit/index")
    public String getVisit(@RequestBody Map<String,Object> map) {
        return personalQueryService.getPersonalAll(map);
    }
}
